package com.ang.jwt.util;

import io.jsonwebtoken.Claims;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ssang
 * @date 2022-07-27 14:15
 */
public class Test2 {
    public static void main(String[] args) {
        Map<String,Object> params = new HashMap<>();
        params.put("auth","admin");
        params.put("sex","男");
        params.put("age",30);
        String token = JwtUtil2.createJwtToken("angss", 1000*60*5L, null, params);
        System.out.println(token);

        Claims claims = JwtUtil2.getClaims(token);
        System.out.println(claims.get("auth"));
        System.out.println(claims.get("age"));
    }
}
